app.controller('repayController', function ($controller,$scope,repayService) {
    $controller('baseController',{$scope:$scope});  //继承
    
    var billId = localStorage.getItem("billId");
    var orderId = localStorage.getItem("orderId");  
    var whichMoney = localStorage.getItem("whichMoney");  
    var createDate = localStorage.getItem("createDate");  
    var endDate = localStorage.getItem("endDate");  

    $scope.bill = {
    
    }
    $scope.billId = billId;
    $scope.orderId = orderId;
    $scope.whichMoney = whichMoney;
    $scope.createDate = createDate;
    $scope.endDate = endDate;
    $scope.findRepayBill=function(){
        repayService.findRepayBill(bid).success(function(response){
           
           $scope.bill = response.data;
           console.log($scope.bill);
        })
    }

    $scope.sendMsg=function(billId){
        repayService.sendMsg(billId).success(function(response){
           $scope.code = response.code;
        })
    }
    $scope.repaymentOrder=function(billId,code){
        repayService.repaymentOrder(billId,code).success(function(response){
            if(response.code==0){
                alert(response.data);
                location = "../page/user_center.html";
            } else{
                alert(response.data);
            }
        })
    }
    
})